public class SwitchExcise2 {
    public static void main(String[] args) {
        int type=(int)(Math.random()*4)+1;
        int num=(int)(Math.random()*13)+1;

        char numchar;

        switch (num)
        {
            case 1:
                numchar='A';
                break;
            case 11:
                numchar='J';
                break;
            case 12:
                numchar='Q';
                break;
            case 13:
            numchar='K';
            break;
            default:
                numchar=(char) (num+48);

        }

        switch (type){
            case 1:
            System.out.println("红桃"+numchar);
            break;
            case 2:
            System.out.println("黑桃"+numchar);
            break;
            case 3:
            System.out.println("方片"+numchar);
            break;
            case 4:
            System.out.println("草花"+numchar);
            break;

    }}
}
